import javax.imageio.*;
import java.awt.*;
import java.awt.image.*;
import java.io.*;

public class S
{
    public static void main (String... argv) throws Exception
    {
        int length = 48;
        int width = 8;
        int img_width = length;
        int img_height = width;
        BufferedImage buffer = new BufferedImage(img_width, img_height, BufferedImage.TYPE_INT_ARGB);
        Graphics2D offscreen = buffer.createGraphics();
        offscreen.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        
        if (false)
        {
            offscreen.setColor(Color.BLACK);
            offscreen.fillRect(0, 0, img_width, img_height);
        }
        
        offscreen.setColor(Color.RED);
        offscreen.fillOval(0, 0, width, width);
        Point[] pp = new Point[]{
            new Point(width/2, 0),
            new Point(length, width/2),
            new Point(width/2, width)
        };
        int[] xx = new int[pp.length];
        int[] yy = new int[pp.length];
        for (int k=0; k<pp.length; k++) xx[k] = pp[k].x;
        for (int k=0; k<pp.length; k++) yy[k] = pp[k].y;
        offscreen.fillPolygon(xx, yy, pp.length);
        
        
        offscreen.setColor(Color.ORANGE);
        offscreen.fillOval(width/4, width/4, width/2, width/2);
        pp = new Point[]{
            new Point(width/2, width/4),
            new Point(length-8, width/2),
            new Point(width/2, width*3/4)
        };
        xx = new int[pp.length];
        yy = new int[pp.length];
        for (int k=0; k<pp.length; k++) xx[k] = pp[k].x;
        for (int k=0; k<pp.length; k++) yy[k] = pp[k].y;
        offscreen.fillPolygon(xx, yy, pp.length);
        
        ImageIO.write(buffer, "PNG", new File("laser.png"));
    }
}
